<template>
  <FGDialog ref="FGDialog" width="800px" title="编辑数据" @confirm="confirm">
    <JsonEditor v-model="jsonContent" />
  </FGDialog>
</template>

<script>
import JsonEditor from "./JsonEditor";
export default {
  name: "JsonDialog",
  components: { JsonEditor },
  props: {
    modelValue: {},
  },
  data() {
    return {
      jsonContent: {},
    };
  },
  methods: {
    open() {
      this.jsonContent = this.modelValue;
      this.$refs.FGDialog.open();
    },
    confirm() {
      this.$emit("input", this.jsonContent);
      this.$emit("confirm", this.jsonContent);
      this.$refs.FGDialog.close();
    },
  },
};
</script>

<style lang="scss" >
</style>